import React, {Component} from 'react';

class Event_handling extends Component
{
    a=1000
    render()
    {
        return (
            <div>
                <input/>
                <button onClick={()=>{
                    console.log("add")
                }}>add</button>
                {/*在调用非标签内的函数时不要加括号*/}
                <button onClick={this.handleClick}>add2</button>
                <button onClick={this.handleClick3}>add3</button>
                <button onClick={()=>{
                    this.handleClick4()
                }}>add4</button>
            </div>
        );
    }
    handleClick(){
        console.log("loy")
    }
    handleClick3=()=>{
        console.log("齐天大圣到此一游！");
    }
    handleClick4=()=>{
        console.log("齐天大圣到此一游！");
    }
}

export default Event_handling ;
